(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=O Guardião
Title=e-Pipoca
Description=Movie importation script for e-Pipoca
Site=www.epipoca.com.br
Language=PT
Version=1.1 (24 Maio 2005)
Requires=3.5.0
Comments=Caso detectem erros coloquem-nos no meu site: www.guardiao.pt.vu ou enviem para o email: bruno_mga@hotmail.com
License=This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
GetInfo=1
[Options]
***************************************************)
program EPipoca;
uses
StringUtils1;
var
MovieName: string;
MovieURL: string;
function HTMLRemove(Value: String): String;
begin
HTMLDecode(Value);
HTMLRemoveTags(Value);
Value := Trim(Value);
result := Value;
end;
procedure AnalyzeFilmPage(Address: String);
var
Page : TStringList;
nome_orig, ano, value : string;
LineNr, BeginPos, EndPos: Integer;
begin
Page := TStringList.Create;
Page.Text := GetPage(Address);
SetField(fieldURL, Address);
value:=Page.Text;
BeginPos:= pos('
(',value)+15;
value:=Copy(value,BeginPos,Length(value));
EndPos := pos('', value);
nome_orig:=copy(value,1,EndPos-1);
SetField(fieldOriginalTitle, nome_orig);
BeginPos:=Pos(')',value);
ano:=copy(value,BeginPos-4,4);
SetField(fieldYear, ano);
if Copy(value,BeginPos-6,1) =',' then
begin
value:=Copy(value,EndPos+6,BeginPos-EndPos-12);
SetField(fieldCountry, value);
end;
value := TextBetween(Page.Text,'Duração: ',' min
');
SetField(fieldLength,value);
LineNr := FindLine('Distribuidora',Page,0);
if LineNr<>-1 then
begin
value := Page.GetString(LineNr+2);
EndPos:=Pos('
',value);
value :=Copy(value,1,EndPos-1);
SetField(fieldProducer,value);
end;
LineNr := FindLine('